package com.zretc.demojparedis.entity;



import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Version;
import java.io.Serializable;

/**
 * 实体类
 * @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
 * 使用jpA的getOne方法出现异常
 */
@Entity
//@Proxy(lazy = false)
//@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
public class Question  implements Serializable {
    @Id
    private int qid;
    @Column(name = "title")
    private String qtitle;
    private String content;
    private String qdate;
    //import javax.persistence.Version;
    @Version
    private int version;

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    @Override
    public String toString() {
        return "Question{" +
                "qid=" + qid +
                ", qtitle='" + qtitle + '\'' +
                ", content='" + content + '\'' +
                ", qdate='" + qdate + '\'' +
                '}';
    }

    public Question() {
    }

    public int getQid() {
        return qid;
    }

    public void setQid(int qid) {
        this.qid = qid;
    }

    public String getQtitle() {
        return qtitle;
    }

    public void setQtitle(String qtitle) {
        this.qtitle = qtitle;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getQdate() {
        return qdate;
    }

    public void setQdate(String qdate) {
        this.qdate = qdate;
    }

    public Question(int qid, String qtitle, String content, String qdate) {
        this.qid = qid;
        this.qtitle = qtitle;
        this.content = content;
        this.qdate = qdate;
    }
}
